package org.ucas.faker.web.exceptions;

import org.springframework.http.HttpStatus;

public class BadRequestException extends RestException {

  public BadRequestException(ErrCode errCode) {
    super(errCode);
  }


  public static final BadRequestException DEPOT_ALREADY_EXISTS =
      new BadRequestException(ErrCode.DEPOT_ALREADY_EXISTS);

  public static final BadRequestException DEPOT_NOT_EXISTS =
      new BadRequestException(ErrCode.DEPOT_NOT_EXISTS);

  public static BadRequestException of(String msg) {
    return new BadRequestException(new ErrCode(
        HttpStatus.BAD_REQUEST, msg));
  }
}
